package com.ruoyi.dl.controller.wechat;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.dl.domain.DlUser;
import com.ruoyi.dl.service.IDlUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 前台用户Controller
 * 
 * @author ruoyi
 * @date 2021-01-05
 */
@Controller
@RequestMapping("/wechat/user")
public class WechatUserController extends BaseController
{
    @Autowired
    private IDlUserService dlUserService;

    /**
     * 查询前台用户列表
     */
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(DlUser dlUser)
    {
        List<DlUser> list = dlUserService.selectDlUserList(dlUser);
        return getDataTable(list);
    }

    //根据userId查询用户信息
    @PostMapping("/selectUserById")
    @ResponseBody
    public AjaxResult selectActivityById(Integer userId) {
        return AjaxResult.success("成功", dlUserService.selectDlUserById(userId));
    }
}
